'use strict';

const bcrypt = require("bcryptjs");
/** @type {import('sequelize-cli').Migration} */
module.exports = {
    async up(queryInterface, Sequelize) {
        await queryInterface.bulkInsert('Menus', [
            {
                id: 1,
                menuType: 0,
                parentId: 0,
                title: "系统管理",
                name: "SystemMenu",
                path: "/systemMenu",
                rank: 99,
                icon: "ep:tools",
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 2,
                menuType: 0,
                parentId: 1,
                title: "权限管理",
                name: "Permission",
                path: "/permission",
                rank: 99,
                icon: "ep:switch-button",
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 3,
                menuType: 0,
                parentId: 1,
                title: "菜单列表",
                name: "Menu",
                path: "/menu/index",
                rank: 99,
                icon: "ep:menu",
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 4,
                menuType: 0,
                parentId: 2,
                title: "按钮权限",
                name: "PermissionBtn",
                path: "/permission/button/index",
                rank: 99,
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 5,
                menuType: 3,
                parentId: 4,
                title: "删除",
                rank: 99,
                auths: "delete",
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 6,
                menuType: 3,
                parentId: 4,
                title: "添加",
                rank: 99,
                auths: "add",
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 7,
                menuType: 3,
                parentId: 4,
                title: "修改",
                rank: 99,
                auths: "edit",
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 8,
                menuType: 0,
                parentId: 2,
                title: "页面权限",
                name: "PermissionPage",
                path: "/permission/page/index",
                rank: 99,
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()

            }, {
                id: 9,
                menuType: 0,
                parentId: 1,
                title: "角色管理",
                name: "Role",
                path: "/system/role/index",
                rank: 99,
                icon: "ri:admin-fill",
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 10,
                menuType: 0,
                parentId: 1,
                title: "部门管理",
                name: "Dept",
                path: "/system/dept/index",
                rank: 99,
                icon: "ri:git-branch-fill",
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()
            }, {
                id: 11,
                menuType: 0,
                parentId: 1,
                title: "用户管理",
                name: "SystemUser",
                path: "/system/user/index",
                rank: 99,
                icon: "ri:admin-line",
                frameLoading: 1,
                keepAlive: 0,
                hiddenTag: 0,
                fixedTag: 0,
                showLink: 1,
                showParent: 0,
                createdAt: new Date(),
                updatedAt: new Date()
            },
        ], {});
    },

    async down(queryInterface, Sequelize) {
        /**
         * Add commands to revert seed here.
         *
         * Example:
         * await queryInterface.bulkDelete('People', null, {});
         */
    }
};
